<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title></title>
	<link rel="stylesheet" href="http://127.0.0.1/jumeiphp/Application/Admin/View/Public/Bootstrap/Css/bootstrap.min.css" />
	<link rel="stylesheet" href="http://127.0.0.1/jumeiphp/Application/Admin/View/Public/Css/common.css" />
	<style type="text/css">
		body{
			margin-bottom: 100px;
		}
	</style>
</head>
<body>
	<div class="container-fluid">
	<div class="row-fluid">
	<div class="span12">

	<table class="table table-bordered table-hover">
		<tr>
			<th>ID</th>
			<th>商品名称</th>
			<th>价格</th>
			<th>库存</th>
			<th>点击次数</th>
			<th>添加时间</th>
			<th>操作</th>
		</tr>	
		<?php foreach ($data as $k=>$v){?>	
		<tr class="info">
			<td><?php echo $v['gid'];?></td>
			<td><?php echo $v['gname'];?></td>
			<td>
				<ul>
					<li>市场价：<del>&yen;<?php echo $v['market_price'];?></del></li>
					<li>商城价：<span>&yen;<?php echo $v['mall_price'];?></span></li>
				</ul>
			</td>
			<td><?php echo $v['total'];?></td>
			<td><?php echo $v['click_num'];?></td>
			<td><?php echo date('Y-m-d',$v['shelf_time']);?></td>
			<td>
				<a href="<?php echo U('GoodsList/index',array('gid'=>$v['gid'],'tid'=>$v['type_tid']));?>" class="btn btn-success"><i class="icon-th icon-white"></i>货品列表</a>
				<a href="javascript:edit(<?php echo $v['gid'];?>)" class="btn btn-warning"><i class="icon-pencil icon-white"></i>修改</a>
				<a href="javascript:del(<?php echo $v['gid'];?>)" class="btn btn-danger"><i class="icon-trash icon-white"></i>下架</a>
			</td>
		</tr>
		<?php }?>
		
	</table>
	<script type="text/javascript">
	function del(gid){
		if(confirm('确定要删除吗？')){
				location.href = "<?php echo U('Admin/Goods/del');?>" + "&gid=" + gid;
			}
	}
	function edit(gid){
		if(confirm('请注意：编辑商品以后该商品下的货品需要重新添加！确定要修改吗？')){
				location.href = "<?php echo U('Admin/Goods/edit');?>" + "&gid=" + gid;
			}
	}
	</script>
	</div>
	</div>
	</div>
</body>
</html>